package com.wisdytech.common.websocket.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.wisdytech.common.websocket.handler.RedisReceiver;

/**
 * redis监听配置类
 * @author dlb
 *
 */
//@Configuration
public class RedisSubListenerConfig {
	
	/*@Value("{spring.redis.topic}")
	private String topic;
	
	
	@Bean
	RedisMessageListenerContainer container(RedisConnectionFactory connectionFactory,
			MessageListenerAdapter listenerAdapter) {
		RedisMessageListenerContainer container = new RedisMessageListenerContainer();
        container.setConnectionFactory(connectionFactory);
        container.addMessageListener(listenerAdapter, new PatternTopic(topic));
        return container;
	}
	
	@Bean
	MessageListenerAdapter listenerAdapter(RedisReceiver receiver) {
		return new MessageListenerAdapter(receiver ,"receiveMessage");
	}
	
	
	@Bean
    StringRedisTemplate template(RedisConnectionFactory connectionFactory){
        return new StringRedisTemplate(connectionFactory);
    }*/
	
}
